package com.area.mapper;

import com.area.entity.Brand;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author guanfenga@yonyou.com
 * @since 2023-01-10
 */
public interface BrandMapper extends BaseMapper<Brand> {

    String coloums = "`brandId`, `brandName`, `title`, `brandBigImageUrl`, `synopsis`, " +
            "`brandImageUrl`, `sortCode`, `isShow`, `isRecommend`, `isHomePage`, `firstLetter` ";
    /**
     * 查询所有品牌信息
     * @param brand
     * @return
     */
    @Select("select "+coloums+" from mall_brand b")
    List<Brand> queryBrandAll(Brand brand);

    /**
     * 根据品牌Id查询一条数据
     * @param brandId
     * @return
     */
    @Select("select "+coloums+" from mall_brand b where b.brandId = #{brandId}")
    Brand queryBrandId(@Param("brandId") Integer brandId);
}
